#ifndef _RR_CONFIG_H_
#define _RR_CONFIG_H_
#include <string>
#include <map>
using std::string;
using std::map;

class IniReader
{
public:
    IniReader()
    {
    }
    ~IniReader()
    {
    }
    bool ReadConfig(const string & filename);
    string ReadString(const char* section, const char* item, const char* default_value);
    string ReadString(const char* section, const char* item);
    int ReadInt(const char* section, const char* item, const int& default_value);
    float ReadFloat(const char* section, const char* item, const float& default_value);
private:
    bool IsSpace(char c);
    bool IsCommentChar(char c);
    void Trim(string & str);
    bool AnalyseLine(const string & line, string& section, string & key, string & value);

private:
    //map<string, string> settings_;
    map<string, map<string, string> >settings_;
};

#endif
